#!/bin/bash


# 渠道列表
channel=(
#  "android-shanqianjk-flyme"
  "MI001"
#  "VIVO001"
  "APP001"
#  "OPPO001"
#  "HUAWEI001"
#  "Open360"
#  "YYB001"
#  "MEIZU001"
);
# 获取当前日期，格式为年月日（例如：2023-08-01）
current_date=$(date +%m-%d)

mkdir apks
#64位包命令  --target-platform android-arm64
#打包前注意修改安卓原生代码中的友盟用渠道号
for item in ${channel[*]}
do
    flutter build apk --release --flavor "channel1" --dart-define=APP_CHANNEL="$item"
    mv build/app/outputs/flutter-apk/app-"channel1"-release.apk apks/"${item}"-"${current_date}".apk

done

##
# 命令行
# chmod +x build_apk.sh

# ./build_apk.sh